The Look-and-Say Sequence Through the Eyes of a Scala Enthusiast

BTI360 Blog / July 18, 2014 in 

Over the last week we’ve been taking a journey through ways to think differently about how to code the Look-and-Say sequence using some code examples. Today, we continue that journey through the eyes of a Scala enthusiast.

Ricky’s submission was the unique Scala submission. It has recursive, regular expression, and non-recursive solutions. It demonstrates use of a left-fold operation — one of a number of functional language operations not currently available in the Java 7 standard libraries. This being the version that most, if not all of us, use on project. However, some higher-order functions, including a variation of the left fold, are available in Java 8 and I’m sure we all look forward to the day when we can use these features from 9-5!

Take a look at Ricky’s code…

Previous

How to Code Kata Ruby Style

Next

How Clean and Simple Code Can Be

Close Form

Enjoy our Blog?

Then stay up-to-date with our latest posts delivered right to your inbox.

  • This field is for validation purposes and should be left unchanged.

Or catch us on social media

Stay in Touch

Whether we’re honing our craft, hanging out with our team, or volunteering in the community, we invite you to keep tabs on us.

  • This field is for validation purposes and should be left unchanged.